<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        img {
            width: 400px;
            border-radius: 10px;
            margin: 8px;
        }

        #copy {
            width: 50px;
            height: 40px;
        }
    </style>
</head>

<body>
    <div id="box">
        <img src="./imges/库里.png" alt="">
    </div>
    <button id="copy">克隆</button>

    <script>
        let copyEle = document.querySelector('#copy');
        let boxEle = document.getElementById('box');
        let imgEle = document.querySelector('img');
        copyEle.addEventListener('click', () => {
            //克隆节点
            let newImg = imgEle.cloneNode(true);
            //  console.log(newImg);
            //把克隆放到box里
            boxEle.appendChild(newImg);
        });

    </script>
</body>

</html>